#python中的 int 可以自动扩容
a = 21000292019201029102019291029102012019
print(type(a))
print(a)

#python 中的逻辑运算符 and or not
a = 1
b = 2
c = 3
print(a < b and b > c)
print(a > b or b < c)
print(not a < b)
print(not a > b)
print("****************************")

#逻辑运算符具有短路现象
#and 逻辑运算符当左边表达式结果为 False，右边表达式不进行计算
print(a > b and 10 / 0 == 1)
#or 逻辑运算符当左边表达式为 True，右边表达式不进行计算
print(a < b or 10 / 0 == 1)

#python中支持链式复制与多元赋值
#先将 b 赋值为 1，再将 b 赋值给 a
a = b = 1
print(a)
print(b)
#多元赋值，a = 1, b = 2
a, b = 1, 2
print(a)
print(b)
#可以利用多元赋值实现交换
a, b = b, a
print(a)
print(b)

#python中具有复合赋值符号
a += 1
a -= 1
a /= 2
a *= 2
a **= 2
a //= 2
a %= 2

#python中还有身份运算符 is 与 is not
#本质是检查两个对象是否指向同一块地址空间
a = 1
print(a is 1)
#通过id函数来求一个对象的地址
print(id(a))
print(id(1))

s1 = "hello"
s2 = "hello"
print(s1 is s2)
print(id(s1))
print(id(s2))

#还有成员运算符 in 与 not in
ls1 = [1, 2, 3]
a = 1
print(a in ls1)
print(1 in ls1)
print(1 not in ls1)








